package com.jeesite.modules.fl.entity;

import java.util.List;
import java.util.Map;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.common.utils.excel.annotation.ExcelField;
import com.jeesite.modules.sys.entity.Area;

import javax.print.Doc;

import org.hibernate.validator.constraints.Length;

@Table(name = "fl_clinic", alias = "a", columns = {
        @Column(name = "id", attrName = "id", label = "id", isPK = true),
        @Column(name = "name", attrName = "name", label = "诊所名称", queryType = QueryType.LIKE),      
        @Column(name = "short_name", attrName = "shortName", label = "诊所简称"),
        @Column(name = "en_name", attrName = "enName", label = "英文名称", queryType = QueryType.LIKE),
        @Column(name = "province", attrName = "province.areaCode", label = "所在省份"),
        @Column(name = "city", attrName = "city.areaCode", label = "所在城市"),
        @Column(name = "address", attrName = "address", label = "详细地址"),
        @Column(name = "en_address", attrName = "enAddress", label = "英文详细地址"),
        @Column(name = "telephone", attrName = "telephone", label = "联系电话"),
        @Column(name = "business_hours", attrName = "businessHours", label = "可预约时间"),
        @Column(name = "business_days", attrName = "businessDays", label = "营业时间（网站）"),
        @Column(name = "en_business", attrName = "enBusiness", label = "英文营业时间（网站）"),
		@Column(name = "business_days_wechat", attrName = "businessDaysWechat", label = "营业时间(公众号)"),
		@Column(name = "en_business_days_weChat", attrName = "enBusinessDaysWechat", label = "英文营业时间（公众号）"),
		/*@Column(name = "remarks", attrName = "remarks", label = "诊所介绍"),*/
		@Column(name = "en_description", attrName = "enDescriptions", label = "英文诊所介绍"),
        @Column(name = "service_time", attrName = "serviceTime", label = "服务时间片"),
        @Column(name = "number", attrName = "number", label = "单位时间片服务人数"),
        @Column(name = "service_area", attrName = "serviceArea", label = "服务范围"),
        @Column(name = "service_enterprise", attrName = "serviceEnterprise", label = "可服务企业", queryType = QueryType.LIKE),
        @Column(name = "picture", attrName = "picture", label = "图片上传"),
        @Column(name = "picture_name", attrName = "pictureName", label = "图片文件名"),
        @Column(name = "coord", attrName = "coord", label = "地图坐标"),
		@Column(name = "allow_schedule", attrName = "allowSchedule", label = "允许预约"),
        @Column(includeEntity = DataEntity.class),
	},  joinTable = {
        @JoinTable(type = Type.LEFT_JOIN, entity = Area.class, alias = "p", on = "p.area_code = a.province", attrName = "province", columns = {@Column(name = "area_name", label = "名称")}),
        @JoinTable(type = Type.LEFT_JOIN, entity = Area.class, alias = "c", on = "c.area_code = a.city", attrName = "city", columns = {@Column(name = "area_name", label = "名称")}),
	}, orderBy = "a.update_date DESC"
)
public class Clinic extends DataEntity<Clinic>{
	private static final long serialVersionUID = 1L;
	
	private String id;
	private String name;
	private Area province;
	private Area city;
	private String address;
	private String telephone;
	private String businessHours;
	private Integer serviceTime;
	private Integer number;
	private String serviceArea;
	private String serviceEnterprise;
	private String picture;
	private String departments;
	private String shortName;
	private String pictureName;
	private List<Map<String,String>> departmentList;
	private Boolean isEnterprise;
	private String businessDays;
	private String coord;
	private String enAddress;
	private String enBusiness;
	private String enDescriptions;
	private String enName;
	private String businessDaysWechat;
	private String enBusinessDaysWechat;
	private List<Doctor> doctorList;
	private String allowSchedule;//允许预约
	/*private String remarks;*/

	public Clinic(){
		super();
	}
	
	public Clinic(String id){
		super(id);
	}
	
	public String getId() {
		return id;
	}
	
	public void setId(String id) {
		this.id = id;
	}
	
	@ExcelField(title="诊所名称", sort=2)
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	@ExcelField(title="所在省份", sort=4)
	public Area getProvince() {
		return province;
	}
	
	public void setProvince(Area province) {
		this.province = province;
	}
	
	@ExcelField(title="所在城市", sort=5)
	public Area getCity() {
		return city;
	}
	
	public void setCity(Area city) {
		this.city = city;
	}
	
	@ExcelField(title="详细地址", sort=6)
	public String getAddress() {
		return address;
	}
	
	public void setAddress(String address) {
		this.address = address;
	}
	
	@ExcelField(title="联系电话", sort=7)
	public String getTelephone() {
		return telephone;
	}
	
	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}
	
	public Integer getNumber() {
		return number;
	}
	
	public void setNumber(Integer number) {
		this.number = number;
	}
	
	@ExcelField(title="图片上传", sort=9)
	public String getPicture() {
		return picture;
	}
	
	public void setPicture(String picture) {
		this.picture = picture;
	}

	@ExcelField(title="营业时间", sort=10)
	public String getBusinessHours() {
		return businessHours;
	}

	public void setBusinessHours(String businessHours) {
		this.businessHours = businessHours;
	}

	public Integer getServiceTime() {
		return serviceTime;
	}

	public void setServiceTime(Integer serviceTime) {
		this.serviceTime = serviceTime;
	}

	@ExcelField(title="服务范围", sort=12, dictType="fl_service_area")
	public String getServiceArea() {
		return serviceArea;
	}

	public void setServiceArea(String serviceArea) {
		this.serviceArea = serviceArea;
	}

	@ExcelField(title="可服务企业", sort=13)
	public String getServiceEnterprise() {
		return serviceEnterprise;
	}

	public void setServiceEnterprise(String serviceEnterprise) {
		this.serviceEnterprise = serviceEnterprise;
	}

	public String getDepartments() {
		return departments;
	}

	public void setDepartments(String departments) {
		this.departments = departments;
	}

	@ExcelField(title="诊所简称", sort=3)
	public String getShortName() {
		return shortName;
	}

	public void setShortName(String shortName) {
		this.shortName = shortName;
	}

	public String getPictureName() {
		return pictureName;
	}

	public void setPictureName(String pictureName) {
		this.pictureName = pictureName;
	}

	public List<Map<String, String>> getDepartmentList() {
		return departmentList;
	}

	public void setDepartmentList(List<Map<String, String>> departmentList) {
		this.departmentList = departmentList;
	}

	public Boolean getIsEnterprise() {
		return isEnterprise;
	}

	public void setIsEnterprise(Boolean isEnterprise) {
		this.isEnterprise = isEnterprise;
	}

	public String getBusinessDays() {
		return businessDays;
	}

	public void setBusinessDays(String businessDays) {
		this.businessDays = businessDays;
	}

	public String getCoord() {
		return coord;
	}

	public void setCoord(String coord) {
		this.coord = coord;
	}

	public String getEnAddress() {
		return enAddress;
	}

	public void setEnAddress(String enAddress) {
		this.enAddress = enAddress;
	}

	public String getEnBusiness() {
		return enBusiness;
	}

	public void setEnBusiness(String enBusiness) {
		this.enBusiness = enBusiness;
	}

	public String getEnDescriptions() {
		return enDescriptions;
	}

	public void setEnDescriptions(String enDescriptions) {
		this.enDescriptions = enDescriptions;
	}

	public String getEnName() {
		return enName;
	}

	public void setEnName(String enName) {
		this.enName = enName;
	}

	public String getBusinessDaysWechat() {
		return businessDaysWechat;
	}

	public void setBusinessDaysWechat(String businessDaysWechat) {
		this.businessDaysWechat = businessDaysWechat;
	}

	public String getEnBusinessDaysWechat() {
		return enBusinessDaysWechat;
	}

	public void setEnBusinessDaysWechat(String enBusinessDaysWechat) {
		this.enBusinessDaysWechat = enBusinessDaysWechat;
	}

	public List<Doctor> getDoctorList() {
		return doctorList;
	}

	public void setDoctorList(List<Doctor> doctorList) {
		this.doctorList = doctorList;
	}

	public String getAllowSchedule() {
		return allowSchedule;
	}

	public void setAllowSchedule(String allowSchedule) {
		this.allowSchedule = allowSchedule;
	}

/*	public String getRemarks() {
		return remarks;
	}
	
	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}*/
}
